#!/bin/bash
echo "===================================================="
if [ ! -z "$HOST_IP" ]; then
    echo "advertised host: $HOST_IP"
    sed -r -i "s/#(advertised.host.name)=(.*)/\1=$HOST_IP/g" $KAFKA_HOME/config/server.properties
    #sed -r -i "s/#(host.name)=(.*)/\1=$HOST_IP/g" $KAFKA_HOME/config/server.properties
fi
echo "===================================================="
$KAFKA_HOME/bin/zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties &

$KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties 
